//
//  ProductCollectionViewCell.m
//  LazyCat
//
//  Created by zhanshu on 15/9/8.
//  Copyright (c) 2015年 zhanshu. All rights reserved.
//

#import "ProductCollectionViewCell.h"

@implementation ProductCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
    
}
- (IBAction)btnClick:(UIButton *)sender {
    if ([_delegate respondsToSelector:@selector(collectionCell:btn:countLable:)]) {
        [_delegate collectionCell:self btn:sender countLable:_countLable];
    }
}
- (void)theNowPrice:(NSString *)nowPrice oldPrice:(NSString*)oldPrice {
    CGFloat nowPriceW = [Utils widthForString:[NSString stringWithFormat:@"¥%@",nowPrice] fontSize:15 andHeight:20];
    CGFloat oldPriceW = [Utils widthForString:[NSString stringWithFormat:@"¥%@",oldPrice] fontSize:11 andHeight:20];
    
    CGRect frame = _nowPriceLable.frame;
    frame.size.width = nowPriceW;
    _nowPriceLable.frame = frame;
    
    frame = _oldPriceLable.frame;
    frame.size.width = oldPriceW;
    frame.origin.x = 3+_nowPriceLable.right;
    _oldPriceLable.frame = frame;
    
    frame = _lineLable.frame;
    frame.origin.y = _oldPriceLable.top+(_oldPriceLable.height-1)/2+1;
    frame.size.width = oldPriceW;
    frame.origin.x = 3+_nowPriceLable.right;
    _lineLable.frame = frame;
}
@end
